<?php
if(isSet($_POST['ID']))
{
	$Info = $_POST['ID'];
	$db = new Database();
	
	
	$getInfo = $db->query("SELECT * FROM tag WHERE id='$Info'","array");
	foreach($getInfo as $data)
	{
		$localNum = $data['localNumber'];
		$tagID = $data['id'];
		$getPatch = $db->query("SELECT * FROM tag WHERE localNumber='$localNum' AND id!='$tagID'","row");
		echo
		'
		<div id="getInformation">
		<div class="titleBar">
			<div class="titlePosition">
			Information
			</div>
		     </div>
		     <div class="Holdercontent">
			<div class="top">
			   <div class="colLeft">
			      <div class="holderLeft">
				 <div class="margin_left">
				    <label class="title">Port Number:</label> <br />
				    <label class="title">Cabinet:</label> <br />
				    <label class="title">Local Number:</label> <br />
				    <label class="title">VLan:</label> <br />
				 </div>
			      </div>
			      <div class="holderRight">
				 <label class="labelContent" id="getPortnumber">'.$getPatch['portNumber'].'</label> <br />
				 <label class="labelContent" id="getCabinet">'.$data['cabinet'].'</label> <br />
				 <label class="labelContent" id="localNumber">'.$localNum.'</label> <br />
				 <label class="labelContent" id="vLan">'.$data['vLan'].'</label> <br />
			      </div>
			   </div>
			   <div class="colRight">
			      <div class="holderLeft">
				 <label class="title">User Information</label> <br />
				 <div class="margin_left">
				    <label class="title">User Name:</label> <br />
				    <label class="title">Division/Section:</label> <br />
				    <label class="title">Location:</label> <br />
				 </div>
			      </div>
			      ';
			      $userData = $data['userID'];
			      $db = new Database();
			      $userProfile = $db->query("SELECT * FROM users WHERE userID='$userData'","array");
			      foreach($userProfile as $userData)
			      {
				echo
				'
			      <div class="holderRight">
				 <label class="labelContent">*</label> <br />
				 <label class="labelContent" id="getUsername">'.$userData['Firstname']. " " .$userData['Lastname'].'</label> <br />
				 <label class="labelContent" id="getDept">'.$userData['UserDept'].'</label> <br />
				 <label class="labelContent" id="getLocation">'.$userData['UserLocation'].'</label> <br />
			      </div>
			      ';
			      }
			      echo
			      '
			   </div>
			</div>
		     <div class="hr"></div>
			<div class="down">
			   <div class="colLeft">
			      <div class="holderLeft">
				 <label class="title">Terminal Type</label> <br />
				 <div class="margin_left">
				    <label class="title">Workstation Type:</label> <br />
				    <label class="title">Description:</label> <br />
				    <label class="title">IP Address:</label> <br />
				    <label class="title">MAC</label> <br />
				 </div>
			      </div>
			      <div class="holderRight">
				 <label class="labelContent">*</label> <br />
				 <label class="labelContent" id="getWorkstation">'.$data['workstation'].'</label> <br />
				 <label class="labelContent" id="getDescription">'.$data['description'].'</label> <br />
				 <label class="labelContent" id="getIP">'.$data['ipAddress'].'</label> <br />
				 <label class="labelContent" id="getMac">'.$data['mac'].'</label> <br />
			      </div>
			   </div>
			   
			   <div class="colRight">
			      <div class="holderLeft">
				 <label class="title">Telephone Terminals</label> <br />
				 <div class="margin_left">
				    <label class="title">Directory Name:</label> <br />
				    <label class="title">Station Type:</label> <br />
				    <label class="title">IP Address:</label> <br />
				    <label class="title">Equip. Add. PBX:</label> <br />
				    <label class="title">Class of Service:</label> <br />
				 </div>
			      </div>
			      <div class="holderRight">
				 <label class="labelContent">*</label> <br />
				 <label class="labelContent" id="getDirectoryName">'.$data['directoryName'].'</label> <br />
				 <label class="labelContent" id="getStationType">'.$data['stationType'].'</label> <br />
				 <label class="labelContent" id="getStationType">'.$data['ttipAddress'].'</label> <br />
				 <label class="labelContent" id="getEquip">'.$data['eaPBX'].'</label> <br />
				 <label class="labelContent" id="getClassService">'.$data['classService'].'</label> <br />
			      </div>
			      </div>
			   </div>
			</div>
		     </div>
		     </div>
		';
	}
	
}
